import request from '@/utils/request';
//import requestUpload from '@/utils/requestUpload';

export async function getLicenseByPage(params: any) {
  return request('/api/sales/getLicenseByPage', {
    method: 'POST',
    data: params,
  });
}

export async function getLicenseTreeByPage(params: any) {
  return request('/api/sales/getLicenseTreeByPage', {
    method: 'POST',
    data: params,
  });
}

export async function getLicenseNextgoingViewByPage(params: any) {
  return request('/api/sales/getLicenseNextgoingViewByPage', {
    method: 'POST',
    data: params,
  });
}

export async function getLicenseOriginalViewByPage(params: any) {
  return request('/api/sales/getLicenseOriginalViewByPage', {
    method: 'POST',
    data: params,
  });
}

export async function addLicense(params: any) {
  return request('/api/sales/addLicense', {
    method: 'POST',
    data: params,
  });
}

export async function delLicense(params: any) {
  return request('/api/sales/delLicense', {
    method: 'POST',
    data: params,
  });
}

export async function delLicenses(params: any) {
  return request('/api/sales/deleteLicenses', {
    method: 'POST',
    data: params,
  });
}

export async function updateLicense(params: any) {
  return request('/api/sales/updateLicense', {
    method: 'POST',
    data: params,
  });
}

export async function updateLicensesUser(params: any) {
  return request('/api/sales/updateLicensesUser', {
    method: 'POST',
    data: params,
  });
}

export async function updateLicensesCustomer(params: any) {
  return request('/api/sales/updateLicensesCustomer', {
    method: 'POST',
    data: params,
  });
}

export async function uploadLicenseExcel(params: any) {
  return request('/api/sales/uploadLicenseExcel', {
    method: 'POST',
    requestType: 'form',
    data: params,
  });
}

/**
 * 下载excel
 * @param params
 * @returns
 */
export async function licenseExcelExport(params: any) {
  return request('/api/sales/licenseExcelExport', {
    method: 'POST',
    responseType: 'blob',
    data: params,
  });
}

export async function getLicenseSumViewByPage(params: any) {
  return request('/api/sales/getLicenseSumViewByPage', {
    method: 'POST',
    data: params,
  });
}

export async function customerList(params: any) {
  return request('/api/order/customerList', {
    method: 'POST',
    data: params,
  });
}

export async function customerCodeList(params: any) {
  return request('/api/order/customerCodeList', {
    method: 'POST',
    data: params,
  });
}

export async function deleteLicensesTree(params: any) {
  return request('/api/sales/deleteLicensesTree', {
    method: 'POST',
    data: params,
  });
}
